/**
 * 
 */
package registnet.courseDemand.extras;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Dexter Ryan Carrasco
 */
public class StudentRec {
	private String studentNumber;
	private Map<String, Integer> courses;
	private int totalUnits = 0;

	public StudentRec() {
		this.courses = new HashMap<String, Integer>();
	}

	public StudentRec(final String studentNumber) {
		this.studentNumber = studentNumber;
		this.courses = new HashMap<String, Integer>();
	}

	public void addCourse(final String course, final int unit) {
		if (!this.courses.containsKey(course)) {
			this.courses.put(course, unit);
			this.totalUnits += unit;
		}
	}

	/**
	 * @return the courses
	 */
	public Map<String, Integer> getCourses() {
		return this.courses;
	}

	/**
	 * @return the studentNumber
	 */
	public String getStudentNumber() {
		return this.studentNumber;
	}

	/**
	 * @return the totalUnits
	 */
	public int getTotalUnits() {
		return this.totalUnits;
	}

	/**
	 * @param courses
	 *            the courses to set
	 */
	public void setCourses(final Map<String, Integer> courses) {
		this.courses = courses;
	}

	/**
	 * @param studentNumber
	 *            the studentNumber to set
	 */
	public void setStudentNumber(final String studentNumber) {
		this.studentNumber = studentNumber;
	}

	/**
	 * @param totalUnits
	 *            the totalUnits to set
	 */
	public void setTotalUnits(final int totalUnits) {
		this.totalUnits = totalUnits;
	}

}
